package com.example.assetmanagement.mapper;

import com.example.assetmanagement.domain.Role;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface RoleMapper {

    List<Role> selectPage(@Param("offset") int offset,
                          @Param("limit") int limit,
                          @Param("name") String name,
                          @Param("status") Integer status);

    long count(@Param("name") String name,
               @Param("status") Integer status);

    Role selectById(@Param("id") Long id);

    int insert(Role role);

    int update(Role role);

    int deleteById(@Param("id") Long id);

    int deleteBatch(@Param("ids") List<Long> ids);

    int updateStatus(@Param("id") Long id, @Param("status") Integer status);

    List<Role> selectAll();
} 